package com.tcl.controller;

import com.tcl.scan.MyConfig;
import com.tcl.scan.User;
import com.tcl.scan.User2;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Import;

/**
 * 注解代表这是主程序类
 */
@SpringBootApplication
@ComponentScan("com.tcl.scan")
public class MainApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(MainApplication.class, args);

        //User bean = run.getBean(User.class);
        //System.out.println(bean);

        boolean user = run.containsBean("user");
        System.out.println(user);

        boolean tom = run.containsBean("tom");
        System.out.println(tom);

        boolean user2 = run.containsBean("user2");
        System.out.println(user2);


    }

}
